package com.xmall.msg.entity.order;

import com.xmall.msg.base.BaseMsg;
import com.xmall.msg.base.MsgSourceType;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class OrderPaySuccessMsg extends BaseMsg implements Serializable {

    /**
     * 订单ID
     */
    private Long orderId;

    /**
     * 订单编号
     */
    private String orderSn;

    /**
     * 第三方交易编号
     */
    private String tradeNo;

    /**
     * 支付时间
     */
    private Date payTime;

    /**
     * 支付方式（0余额 1微信 2支付宝）
     */
    private Integer payType;

    /**
     * 支付平台（0移动端H5 1移动端App 2电脑端 3小程序）
     */
    private Integer payPlatform;

    public OrderPaySuccessMsg build(MsgSourceType msgSourceType, String exchange, String routingKey) {
        super.build(msgSourceType, exchange, routingKey);
        return this;
    }

    private void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    private void setOrderSn(String orderSn) {
        this.orderSn = orderSn;
    }

    private void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    private void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    private void setPayType(Integer payType) {
        this.payType = payType;
    }

    private void setPayPlatform(Integer payPlatform) {
        this.payPlatform = payPlatform;
    }

    public OrderPaySuccessMsg info(Long orderId, String orderSn, String tradeNo, Date payTime, Integer payType, Integer payPlatform) {
        this.orderId = orderId;
        this.orderSn = orderSn;
        this.tradeNo = tradeNo;
        this.payTime = payTime;
        this.payType = payType;
        this.payPlatform = payPlatform;
        return this;
    }
}
